<?php
define('IN_TINPHP', TRUE);
define('TIN_APP_PATH', dirname(__FILE__).'/');
$ws = $_GET['ws'];
$wsFile = TIN_APP_PATH . 'app/service/' . ucfirst($ws) . '.php';
require_once $wsFile;
require_once TIN_APP_PATH."include/webservice/PHYServer.php";
if($_GET['username']!="" || $_GET['password']!=""){
	$server = new PHYServer($_GET['username'], $_GET['password']);
	$server->setClass(ucfirst($ws)."Service");
	$server->handle();
}else{
	echo '{"type":"json","data":"Access Denied"}';
}

//内部调试
// $data = array();
// $data['type']='json';
// $claName = ucfirst($ws)."Service";
// $cla = new $claName();
// $res = $cla->HelloWord($data);
// var_dump($res);
?>